home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ADA Programming Guide
/
ADA Programming Guide.iso
/
adatutor
/
spacemon
/
displayb.src
< prev
next >
Wrap
Text File
|
1996-01-30
|
6KB
|
172 lines
with Spacecraft_Sensor_Interface; use Spacecraft_Sensor_Interface;
with Console; use Console;
with Types; use Types;
with TEXT_IO; use TEXT_IO;
package body CRT_Output is
procedure Display(arg: in PRESSURE_ARRAY) is
Range_per_equal: constant PRESSURE := 5.0;
Equal_signs: INTEGER;
i: SPACECRAFT_SECTION;
package SPACECRAFT_SECTION_IO is new ENUMERATION_IO(SPACECRAFT_SECTION);
use SPACECRAFT_SECTION_IO;
begin
Console.Set_Terminal (VT100);
Console.Enable_Output;
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
Console.Erase_Display;
Console.New_Line;
Console.Put_Line("Pressure min max");
Console.Put_Line(" p.s.i | |");
Console.Put_Line(" V V");
for i in SPACECRAFT_SECTION'FIRST .. SPACECRAFT_SECTION'LAST loop
if arg(i).in_range then
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
else
Console.Set_Rendition(REVERSE_VIDEO);
Console.Put(ASCII.BEL);
end if;
Equal_signs := INTEGER(arg(i).value / Range_per_equal + 1.0);
-- may use Exception here if out of range on Equal_signs
-- Console.Put(" ");
-- SPACECRAFT_SECTION_IO.Put(i);
if i = BRIDGE then Console.Put("BRIDGE ");end if;
if i = AUXILIARY_BRIDGE then Console.Put("AUXILARY BRIDGE ");end if;
if i = CREW_QUARTERS then Console.Put("CREW_QUARTERS ");end if;
if i = GALLEY then Console.Put("GALLEY ");end if;
if i = LAB1 then Console.Put("LAB 1 ");end if;
if i = LAB2 then Console.Put("LAB 2 ");end if;
if i = LAB3 then Console.Put("LAB 3 ");end if;
if i = AIRLOCK1 then Console.Put("AIRLOCK 1 ");end if;
if i = AIRLOCK2 then Console.Put("AIRLOCK 2 ");end if;
if i = EXPERIMENT_BAY then Console.Put("EXPERIMENT BAY ");end if;
for j in 1 .. Equal_signs loop
Console.Put('=');
end loop;
for j in 1 .. 50-Equal_signs loop
Console.Put(' ');
end loop;
Console.Put(FLOAT(arg(i).value),4,2,OUTPUT_FULL_NUMBER,'*');
Console.New_Line;
end loop;
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
end Display;
procedure Display(arg: in RADIATION_ARRAY) is
Range_per_equal: constant RADIATION_LEVEL := 25.0;
Equal_signs : INTEGER;
package SPACECRAFT_SECTION_IO is new ENUMERATION_IO(SPACECRAFT_SECTION);
use SPACECRAFT_SECTION_IO;
begin
Console.Set_Terminal (VT100);
Console.Enable_Output;
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
for j in 1 .. 50 loop
Console.Put('*');
end loop;
Console.New_Line;
Console.Put_Line("Radiation min max");
Console.Put_Line("Roentgens | |");
Console.Put_Line(" V V");
for i in SPACECRAFT_SECTION'FIRST .. SPACECRAFT_SECTION'LAST loop
if arg(i).in_range then
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
else
Console.Set_Rendition(REVERSE_VIDEO);
Console.Put(ASCII.BEL);
end if;
Equal_signs := INTEGER(arg(i).value / Range_per_equal + 1.0);
-- may use Exception here if out of range on Equal_signs
-- SPACECRAFT_SECTION_IO.Put(i);
if i = BRIDGE then Console.Put("BRIDGE ");end if;
if i = AUXILIARY_BRIDGE then Console.Put("AUXILARY BRIDGE ");end if;
if i = CREW_QUARTERS then Console.Put("CREW_QUARTERS ");end if;
if i = GALLEY then Console.Put("GALLEY ");end if;
if i = LAB1 then Console.Put("LAB 1 ");end if;
if i = LAB2 then Console.Put("LAB 2 ");end if;
if i = LAB3 then Console.Put("LAB 3 ");end if;
if i = AIRLOCK1 then Console.Put("AIRLOCK 1 ");end if;
if i = AIRLOCK2 then Console.Put("AIRLOCK 2 ");end if;
if i = EXPERIMENT_BAY then Console.Put("EXPERIMENT BAY ");end if;
for j in 1 .. Equal_signs loop
Console.Put('=');
end loop;
for j in 1 .. 50-Equal_signs loop
Console.Put(' ');
end loop;
Console.Put(FLOAT(arg(i).value),4,2,OUTPUT_FULL_NUMBER,'*');
Console.New_Line;
end loop;
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
end Display;
procedure Display(arg: in TEMPERATURE_ARRAY) is
Range_per_equal: constant TEMPERATURE := 5.0;
Equal_signs : INTEGER;
package SPACECRAFT_SECTION_IO is new ENUMERATION_IO(SPACECRAFT_SECTION);
use SPACECRAFT_SECTION_IO;
begin
Console.Set_Terminal (VT100);
Console.Enable_Output;
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
for j in 1 .. 50 loop
Console.Put('*');
end loop;
Console.New_Line;
Console.Put_Line("Temperature min max");
Console.Put_Line("Degrees F | |");
Console.Put_Line(" V V");
for i in SPACECRAFT_SECTION'FIRST .. SPACECRAFT_SECTION'LAST loop
if arg(i).in_range then
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
else
Console.Set_Rendition(REVERSE_VIDEO);
Console.Put(ASCII.BEL);
end if;
Equal_signs := INTEGER(arg(i).value / Range_per_equal + 1.0);
-- may use Exception here if out of range on Equal_signs
if i = BRIDGE then Console.Put("BRIDGE ");end if;
if i = AUXILIARY_BRIDGE then Console.Put("AUXILIARY BRIDGE ");end if;
if i = CREW_QUARTERS then Console.Put("CREW_QUARTERS ");end if;
if i = GALLEY then Console.Put("GALLEY ");end if;
if i = LAB1 then Console.Put("LAB 1 ");end if;
if i = LAB2 then Console.Put("LAB 2 ");end if;
if i = LAB3 then Console.Put("LAB 3 ");end if;
if i = AIRLOCK1 then Console.Put("AIRLOCK 1 ");end if;
if i = AIRLOCK2 then Console.Put("AIRLOCK 2 ");end if;
if i = EXPERIMENT_BAY then Console.Put("EXPERIMENT BAY ");end if;
for j in 1 .. Equal_signs loop
Console.Put('=');
end loop;
for j in 1 .. 50-Equal_signs loop
Console.Put(' ');
end loop;
Console.Put(FLOAT(arg(i).value),4,2,OUTPUT_FULL_NUMBER,'*');
Console.New_Line;
end loop;
Console.Set_Rendition(ALL_ATTRIBUTES_OFF);
end Display;
end CRT_Output;